<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script src="https://cdn.bootcss.com/socket.io/2.3.0/socket.io.js"></script>
<script>

    const socket = io('http://xf.padssz.com:3863');
    console.log(socket);

    // 连接事件
    socket.on('connect', () => {
        console.log("连接中。。。");
        let param = {id: 10047};
        socket.emit('client-auth', param, (askData) => {
            console.log('服务端回复：' + askData);
        });
    });

    socket.on('disconnect', () => {
        console.log("连接已断开。。。");
    });

    socket.on("server-message", (data, ackRequest) => {
        console.log(data);
        console.log(ackRequest);
    });


</script>

</body>
</html>